﻿@model List<SnongPhoneShop.Models.SanPham>
@{
    ViewBag.Title = "Tìm kiếm sản phẩm";
    Layout = "~/Views/Shared/_LayoutSearchMetroUI.cshtml";
    ViewBag.CurrPage = "Tìm kiếm";
}
<div class="search-sort">
    @if(ViewBag.totalProduct != null){
        <b>Tìm thấy @ViewBag.totalProduct sản phẩm phù hợp. Có tổng số @ViewBag.pageCount trang</b>
    }
    @Html.DropDownList("OrderByList", (SelectList)ViewBag.OrderBy, new { Class = "order-dropdown" })
    @Html.DropDownList("OrderTypeList", (SelectList)ViewBag.OrderType, new { Class = "order-dropdown" })
    <script type="text/javascript">
        $('#OrderByList, #OrderTypeList').change(function () {
            var orderBy = $('#OrderByList').val();
            var orderType = $('#OrderTypeList').val();
            $.ajax({
                url: '/Tim_Kiem/Sort',
                data: { OrderBy: orderBy, OrderType: orderType },
                success: function (html) {
                    $('#search-result-panel').html(html);
                },
                cache: false
            });
        });
    </script>
</div>
<div id="search-result-panel">
    @{Html.RenderPartial("SearchResult", Model);}
</div>
